﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Preyla
{
    public partial class FormLogin : Form
    {
        public int Rights = 0;

        public FormLogin()
        {
            InitializeComponent();
        }

        private void ExitButton_Click(object sender, EventArgs e)
        {
            Close();

            DialogResult = DialogResult.Abort;
        }

        private void LoginButto_Click(object sender, EventArgs e)
        {
            if (LoginText.Text == Properties.Settings.Default.AdminLogin
                && PasswordText.Text == Properties.Settings.Default.AdminPassword)
            {
                Rights = 1;

                Close();
                
            }
            else if (LoginText.Text == Properties.Settings.Default.GuestLogin
                && PasswordText.Text == Properties.Settings.Default.GuestPassword)
            {
                Rights = 2;

                Close();
            }
            else
            {
                MessageBox.Show("Login or password incorrect");
            }
        }
    }
}
